using System;

namespace muduoDotNet.Common
{
    /// <summary>
    /// 通用接口定义
    /// </summary>
    public interface IDisposableResource : IDisposable
    {
        /// <summary>
        /// 资源是否已释放
        /// </summary>
        bool IsDisposed { get; }
    }

    /// <summary>
    /// 命名资源接口
    /// </summary>
    public interface INamedResource
    {
        /// <summary>
        /// 资源名称
        /// </summary>
        string Name { get; }
    }

    /// <summary>
    /// 可启动和停止的组件接口
    /// </summary>
    public interface ILifecycleComponent
    {
        /// <summary>
        /// 组件是否已启动
        /// </summary>
        bool IsStarted { get; }

        /// <summary>
        /// 启动组件
        /// </summary>
        void Start();

        /// <summary>
        /// 停止组件
        /// </summary>
        void Stop();
    }

    /// <summary>
    /// 状态监控接口
    /// </summary>
    public interface IStatusMonitor
    {
        /// <summary>
        /// 获取组件状态
        /// </summary>
        /// <returns>状态信息</returns>
        string GetStatus();

        /// <summary>
        /// 获取统计信息
        /// </summary>
        /// <returns>统计信息</returns>
        object GetStatistics();
    }

    /// <summary>
    /// 配置接口
    /// </summary>
    public interface IConfigurable<T>
    {
        /// <summary>
        /// 配置组件
        /// </summary>
        /// <param name="config">配置对象</param>
        void Configure(T config);
    }
}